{extend name="base" /}
{block name="body"}
<div class="layui-card">
	<div class="layui-card-body">
            <div class="layui-btn-group">
		    <a href="{:url('user/staff/add')}" data-width="416px" data-height="416px" class="layui-btn ajax-iframe"><i class="fa fa-plus-circle"></i> 添加会员</a>
            </div>
		<table class="layui-table layui-form">
			<thead>
				<tr>
					<th>ID</th>
                                        <th>用户组</th>
					<th>用户名</th>
                                        <th>姓名</th>
					<th>手机号</th>
					<th>上次登录时间</th>
					<th>上次登录IP</th>
					<th>登录次数</th>
					<th>创建时间</th>
					<th>状态</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				{foreach name="list" item="v" empty="$empty"}
                                <?php $uaga = model('user_auth_group_access')->where(['uid'=>$v['id']])->find();?>
				<tr>
					<td>{$v.id}</td>
                                        <td>{:model('user_auth_group')->get($uaga.group_id)['name']}</td>
					<td>{$v.username}</td>
                                        <td>{$v.realname}</td>
					<td>{$v.mobile}</td>
					<td>{if empty($v.last_login_time)}无{else/}{$v.last_login_time|date='Y-m-d H:i:s', ###}{/if}</td>
					<td>{$v.last_login_ip|default='无'}</td>
					<td>{$v.login_count}</td>
					<td>{$v.create_time}</td>
					<td>
						<input type="checkbox" name="status" lay-skin="switch" lay-filter="*" lay-text="在职|离职" data-url="{:url('user/staff/edit', ['id' => $v.id])}" {if $v.status eq 1}checked="checked"{/if}>
					</td>
					<td>
						<a href="{:url('user/staff/edit', ['id' => $v.id])}" data-width="416px" data-height="416px" class="layui-btn layui-btn-xs layui-btn-normal ajax-iframe"><i class="fa fa-edit"></i> 编辑</a>
						<a href="{:url('user/staff/del', ['id' => $v.id])}" class="layui-btn layui-btn-xs layui-btn-danger ajax-delete"><i class="fa fa-trash-o"></i> 删除</a>
					</td>
				</tr>
				{/foreach}
			</tbody>
		</table>
		<div class="page">{$list->render()}</div>
	</div>
</div>
{/block}
